package com.controller;

import com.entity.mapper.StudentMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

/**
 * Created by 2429916391@qq.com on 2017/2/17 15:28.
 */
@Controller
public class SsmTest {
    @Autowired
    private StudentMapper studentMapper;
    @RequestMapping("/tt")
    public ModelAndView mm(){
        ModelAndView ma = new ModelAndView("show");//试图show显示
        ma.addObject("ss",studentMapper.query());
        return ma;
    }
    @RequestMapping("/del")
    public String del(int id){
        studentMapper.delById(id);
        return "redirect:/tt";
    }

}
